from base_api.base import BaseApi


class UserApi(BaseApi):
    access_token = None
    corpsecret = 'I0xYImSAp9D1gGiG1iF_mBA9mQFFN6tgHHTh5m-EVrs'
    # 获取token
    def __init__(self):
        self.access_token = self.get_token(self.corpsecret)

    def create(self,userid,name,mobile):
        data = {
            'method': "post",
            'url': 'https://qyapi.weixin.qq.com/cgi-bin/user/create',
            'params': {
                'access_token': self.access_token
            },
            'json': {
                'userid': userid,
                'name': name,
                'mobile': mobile
            }
        }

        return self.send(**data)

    def delete(self):
        ...

    def update(self):
        ...

    def select(self):
        ...
